<!--
 * @Author: chunlai
 * @Date: 2025-01-17 11:55:35
 * @LastEditTime: 2025-01-23 10:11:58
 * @LastEditors: minsheng_insurance_agency_zhoucl
 * @FilePath: \0.newInsure\src\views\prenotice\simple\SureBtns.vue
 * @Description: 
-->

<template>
  <div class="footer-sure-btns">
    <div class="actionBox">
      <div class="btn-span btn-l mr10" @click="saveField(vm)">
        {{ leftText }}
        <div class="znhb-text" v-if="bbrAutoHealthApi == '1' && utype == 'bbr'">
          （可智能核保）
        </div>
      </div>
      <div class="btn-span btn-r" @click="saveForm(vm)">
        {{ rightText }}
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import { debounce } from "@/utils/debounce";
export default {
  name: "SureBtns",
  props: {
    rightText: {
      type: String,
      default: "确认无以上问题",
    },
    leftText: {
      type: String,
      default: "有部分问题",
    },
    utype: {
      type: String,
      default: "tbr",
    },
  },
  data() {
    return {
      vm: this,
    };
  },
  computed: {
    ...mapGetters({
      bbrAutoHealthApi: "page/bbrAutoHealthApi",
    }),
  },
  methods: {
    saveField: debounce(
      (vm) => {
        vm.$emit("saveField");
      },
      1000,
      true
    ),
    saveForm: debounce(
      (vm) => {
        vm.$emit("saveForm");
      },
      1000,
      true
    ),
  },
};
</script>

<style lang="less" scoped>
.footer-sure-btns {
  width: 100%;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
  background-color: #fff;
  padding: 0 15px;
  box-shadow: 0 -0.08rem 0.133333rem 0 rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  .actionBox {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 60px;

    .btn-span {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      flex: 1;
      height: 40px;
      color: #ffffff;
      font-size: 14px;
      letter-spacing: 0;
      border-radius: 40px;
      .znhb-text {
        font-size: 12px;
        line-height: 1;
      }

      &:active {
        opacity: 0.75;
      }

      &.btn-l {
        background-color: #fa9c33;
      }

      &.btn-r {
        background-image: linear-gradient(to right, #ff462c, #cb1800);
      }
    }
  }
}
</style>
